2782. Taking in payment extinguishes the obligation.
A creditor who has taken property in payment may not claim what he pays to a prior or hypothecary creditor whose claim is preferred to his. In such a case, he is not entitled to subrogation against his former debtor.